package com.itheima.d7_thread_communication;

/*
    目标：了解一下线程通信。
    需求：1个生产者线程，负责生产包子，每个线程每次只能生产1个包子放在桌子上
    1个消费者线程负责吃包子，每人每次只能从桌子上拿1个包子吃。
*/
public class ThreadTest {
    public static void main(String[] args) {
        Cook cook = new Cook();
        Foodie foodie = new Foodie();
        Thread cookThead = new Thread(cook,"厨师1");
        Thread cookThead2 = new Thread(cook,"厨师2");
        Thread cookThead3 = new Thread(cook,"厨师3");
        Thread foodieThead = new Thread(foodie,"吃货1");
        Thread foodieThead2 = new Thread(foodie,"吃货2");
        Thread foodieThead3 = new Thread(foodie,"吃货3");
        cookThead.start();
        cookThead2.start();
        cookThead3.start();
        foodieThead.start();
        foodieThead2.start();
        foodieThead3.start();
    }
}
